import os
import yaml

# Project Folder
BASE_DIR = os.path.dirname(os.path.dirname(__file__))

# Load yaml configuration
env = os.getenv('FLASK_ENV')
if env == 'dev_linux':
    config_file = os.path.join(BASE_DIR, 'config', 'dev_linux_config.yaml')
elif env == 'qa_linux':
    config_file = os.path.join(BASE_DIR, 'config', 'qa_linux_config.yaml')
elif env == 'local':
    config_file = os.path.join(BASE_DIR, 'config', 'local_config.yaml')
else:
    config_file = os.path.join(BASE_DIR, 'config', 'local_config.yaml')
with open(config_file, 'r') as file:
    config = yaml.safe_load(file)

# appium config
platform_name = config['appium']['platform_name']
platform_version = config['appium']['platform_version']
device_name = config['appium']['device_name']
app_package = config['appium']['app_package']
unicode_keyboard = config['appium']['unicode_keyboard']
reset_keyboard = config['appium']['reset_keyboard']
no_reset = config['appium']['no_reset']
autoLaunch = config['appium']['capabilities']['autoLaunch']
dontStopAppOnReset = config['appium']['capabilities']['dontStopAppOnReset']
command_executor = config['appium']['command_executor']

# chrome
chrome_path = config['chrome']['chrome-path']
chrome_driver_path = config['chrome']['chrome-driver-path']

if __name__ == '__main__':
    print(platform_name)
    print(autoLaunch)
    print(dontStopAppOnReset)
